package entity.rtsp;

import java.util.Map;

public class RTSPRequestEntity {
    private String version;
    private String method;
    private String targetUri;
    private Map<String, String> headers;
    private byte[] body;


    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getTargetUri() {
        return targetUri;
    }

    public void setTargetUri(String targetUri) {
        this.targetUri = targetUri;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    @Override
    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append(this.method + " " + this.targetUri + " " + this.version);
        sb.append("\r\n");
        for (Map.Entry<String, String> entry : this.headers.entrySet()){
            sb.append(entry.getKey() + ":" + entry.getValue());
            sb.append("\r\n");
        }

        return sb.toString();
    }
}
